<template>
    <div>
       <top2></top2>
       <frame2 title="项目信息">
            <div style="margin-left: auto;margin-right: auto">
                 <el-table id="t" height="400px" :data="tableData"  border stripe style="width:100%;border:1px red solid;">
                     <el-table-column prop="projectName" label="项目名称" style="width:10%;"/>
                     <el-table-column prop="projectCreateTime" label="创建日期" style="width:20%;"/>
                     <el-table-column prop="projectPartnerNum" label="用户数量" style="width:10%;"/>
                     <el-table-column prop="projectSize" label="项目大小" style="width:10%;"/>
                     <el-table-column prop="projectDescription" label="项目描述" style="width:30%;"/>
                     <el-table-column label="操作" style="width:18%;">
                       <template slot-scope="scope">
                         <el-button size="mini" @click="changeData">编辑</el-button>
                         <el-button size="mini" @click="check(scope.$index)">查看</el-button>
                       </template>
                     </el-table-column>
                 </el-table>
                   <el-button type="primary" @click="createProject" style="margin-bottom: 20px;margin-top: 20px">创建项目</el-button>
            </div>
       </frame2>
    </div>

</template>

<script>
import Frame2 from "../lys/Frame.vue";
import top2 from '../base/top'
import bottom2 from "../base/bottom.vue";
import Top from "../base/top.vue";
import {projectList} from "../lys/data/global";

export default {
  components:{Top, Frame2,top2,bottom2},
  data() {
    return {
      tableData: [],
    }
  },
  mounted(){
    this.init()
  },
  methods: {
    init(){
      let config = {
        url:"/cbug/project/getProjectList",
        method:"post",
        data:{
          token:"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJle"
        }
      }
      this.tableData = projectList.projects
    },
    changeData(){
    },
    check(i){
      let projectId = this.tableData[i].projectId
      this.$router.push({path:'/project-detail',query:{projectId}})
    },
    createProject(){
        this.$router.push('/createProject')
    },
    goToMyPartner(){
        this.$router.push('/myPartner')
    }
  },
}
</script>
<style scoped>
    #t{
        margin-left: auto;
        margin-right: auto;
        width:100%;
    }
    #back{
        background-color: white;
        margin: auto;
        /*width: 1200px;*/
    }
    #title{
        width: 100%;
    }

</style>
<style>

</style>
